
package com.bk.bands.template;

import java.util.Collection;
import java.util.LinkedList;
import java.util.List;
import javax.xml.bind.annotation.XmlAccessType;
import javax.xml.bind.annotation.XmlAccessorType;
import javax.xml.bind.annotation.XmlElement;
import javax.xml.bind.annotation.XmlType;

import com.bk.bands.model.Style;
import com.google.common.collect.ForwardingCollection;


@XmlAccessorType(XmlAccessType.PUBLIC_MEMBER)
@XmlType(name = "styles", namespace = "http://com.bk.docs", propOrder = {
    "content"
})
public class XmlStyles {

   protected List<Style> styles = new LinkedList<Style>();

   protected ForwardingCollection<XmlStyle> xmlStylesDecorator = new ForwardingCollection<XmlStyle>()
   {
      private List<XmlStyle> xmlStyles = new LinkedList<XmlStyle>();
      @Override
      protected List<XmlStyle> delegate()
      {
         return xmlStyles;
      }

       public boolean add(XmlStyle element)
       {
          styles.add(element.getStyle());
          return super.add(element);
       }
   };

   public List<Style> getStyles()
   {
      return styles;
   }

   @XmlElement(namespace = "http://com.bk.docs", name = "style")
    public Collection<XmlStyle> getContent() {

        return xmlStylesDecorator;
    }

}
